package com.pai.dao.role;

import com.pai.entity.AppRole;

import java.sql.Connection;
import java.util.List;

public interface RoleDao {
    /**
     * 获取角色列表
     * @param connection
     * @return
     * @throws Exception
     */
    public List<AppRole> getList(Connection connection) throws Exception;

    /**
     * 获取角色详情
     * @param connection
     * @param id
     * @return
     * @throws Exception
     */
    public AppRole getItemDetail(Connection connection, String id) throws Exception;

    /**
     *
     * @param connection
     * @param roleName  角色名称
     * @return
     * @throws Exception
     */
    public AppRole getItemByName(Connection connection, String roleName) throws Exception;

    /**
     * 新增角色
     * @param connection
     * @param role
     * @return
     * @throws Exception
     */
    public int add(Connection connection, AppRole role) throws Exception;




    /**
     * 更新角色
     * @param connection
     * @param role
     * @return
     * @throws Exception
     */
    public int update(Connection connection, AppRole role) throws Exception;

    /**
     * 删除角色
     * @param connection
     * @param id
     * @return
     * @throws Exception
     */
    public int delete(Connection connection, String id) throws Exception;

}
